package com.small.xx.ai.mcp.server.base.component;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Component;

import java.sql.SQLException;
import java.util.Map;

@Component
public class Tool2Component implements BaseToolComponent {

    @Tool(description = "可以获取到某个城市的温度信息")
    public Map<String, String> getTemperature(
        @ToolParam(required = true, description = "入参城市，请传入城市拼音") String city) throws SQLException {
        System.out.println("获取到了城市信息:" + city);
        return Map.of("datas", city + "的温度为零下5度到零下10度");
    }
}